<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>用户列表 - bjyadmin</title>
    <bootstrapcss />
</head>
<body>
<!-- 导航栏开始 -->
<div class="bjy-admin-nav">
    <a href="{:U('Admin/Index/index')}"><i class="fa fa-home"></i> 首页</a>
    &gt;
    用户列表列表
</div>
<form>
    <table class="table table-striped table-bordered table-hover table-condensed">
        <tr>
            <th width="5%">搜索</th>
            <td width="15%">
                <input class="form-control" type="text" name="word" value="{$Think.get.word}">
            </td>
            <td width="80%">
                <input class="btn btn-success" type="submit" value="搜索">
            </td>
        </tr>
    </table>
</form>
<!-- 导航栏结束 -->
<table class="table table-striped table-bordered table-hover table-condensed">
    <tr>
        <th>用户名</th>
        <th>邮箱</th>
        <th>手机号</th>
        <th>状态</th>
        <th>注册时间</th>
        <th>操作</th>
    </tr>
    <foreach name="data" item="v">
        <tr>
            <td>{$v['username']}</td>
            <td>{$v['email']}</td>
            <td>{$v['phone']}</td>
            <td>
                <switch name="v['status']">
                    <case value="0">禁用</case>
                    <case value="1">正常</case>
                    <case value="2">未验证</case>
                </switch>
            </td>
            <td>{$v['register_time']}</td>
            <td>
                <a href="javascript:;" data-uid="{$v['id']}" onclick="add(this)">发放优惠券</a>
            </td>
        </tr>
    </foreach>
</table>
<div class="xb-page">{$page}</div>
<!-- 添加菜单模态框开始 -->
<div class="modal fade" id="bjy-add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
         <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    发放优惠券
                </h4>
            </div>
            <div class="modal-body">
                <form id="bjy-form" class="form-inline" action="{:U('Admin/Coupon/issue_coupon')}" method="post">
                    <input type="hidden" name="uid" value="0">
                    <table class="table table-striped table-bordered table-hover table-condensed">
                        <tr>
                            <th width="12%">优惠券：</th>
                            <td>
                                <empty name="coupon">
                                    暂无可发放的优惠券
                                <else/>
                                    <foreach name="coupon" item="v">
                                        <label>
                                            <input type="radio" name="cid" value="{$v['id']}"> {$v['describe']}({$v['sum']})元
                                        </label> 
                                        &emsp;&nbsp;
                                    </foreach>
                                </empty>
                            </td>
                        </tr>
                        <tr>
                            <th></th>
                            <td>
                                <input class="btn btn-success" type="submit" value="发放">
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>
<!-- 添加菜单模态框结束 -->

<bootstrapjs />
<script>
// 添加菜单
function add(obj){
    var uid=$(obj).attr('data-uid');
    $("input[name='uid']").val(uid);
    $('#bjy-add').modal('show');
}
</script>
</body>
</html>
